package com.yuyou.fn.educational.entity;

import com.github.wens.mybatisplus.annotations.TableField;
import com.github.wens.mybatisplus.annotations.TableId;
import com.github.wens.mybatisplus.annotations.TableName;
import com.github.wens.mybatisplus.examples.Example;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 *
 * 学生报名
 *
 */
@TableName(value = "student_reg")
public class StudentReg implements Serializable ,Comparable<StudentReg> {

	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	public static Example<StudentReg> createExample(){
		return new Example<StudentReg>(StudentReg.class);
	}

	/**  */
	@TableId(value = "reg_id")
	private Long regId;

	/**  */
	@TableField(value = "student_id")
	private Long studentId;

	/** 学生姓名 */
	@TableField(value = "student_name")
	private String studentName;

	/** 班级ID */
	@TableField(value = "class_id")
	private Long classId;

	/** 班级名称 */
	@TableField(value = "class_name")
	private String className;

	/** 注册状态 0：在读 1：转班 2：退账户 3：退班退费 4:无效 */
	@TableField(value = "reg_status")
	private Integer regStatus;

	/** 缴费状态 0:未缴费 1:欠费 2:已缴费 */
	@TableField(value = "charging_status")
	private Integer chargingStatus;

	/** 课程金额 */
	@TableField(value = "total_amount")
	private BigDecimal totalAmount;

	/** 支付金额 */
	@TableField(value = "pay_amount")
	private BigDecimal payAmount;

	/** 退费金额 */
	@TableField(value = "refund_amount")
	private BigDecimal refundAmount;

	/** 报名来源 0：线下 1：线上 2:转班 3:tms */
	@TableField(value = "reg_from")
	private Integer regFrom;


	/**  */
	@TableField(value = "create_time")
	private Date createTime;

	/**  */
	@TableField(value = "update_time")
	private Date updateTime;

	/** 开始讲数 */
	@TableField(value = "start_amount")
	private Integer startAmount;

	/** 结束讲数 */
	@TableField(value = "end_amount")
	private Integer endAmount;

	/** 初始开始讲数 */
	@TableField(value = "init_start_amount")
	private Integer initStartAmount;

	/** 初始结束讲数 */
	@TableField(value = "init_end_amount")
	private Integer initEndAmount;

	/**    */
	@TableField(value = "course_order_id")
	private Long courseOrderId;

	/** 财务主体Id   */
	@TableField(value = "financial_owner_id")
	private Long financialOwnerId;

	/**
	 * 退班状态 0：无 1：申请中 2：完成
	 */
	@TableField(value = "refund_status")
	private Integer refundStatus;

	/**  */
	@TableField(value = "area_team_id")
	private Long areaTeamId;

	/**  */
	@TableField(value = "bus_team_id")
	private Long busTeamId;

	@TableField("period_id")
	private Long periodId ;

	@TableField("src_total_amount")
	private BigDecimal srcTotalAmount ;

	/** 操作人 */
	private String operator;

	@TableField(value = "senior_id")
	private Long seniorId;

	@TableField(value = "senior_name")
	private String seniorName;

	@TableField(value = "operator_id")
	private Long operatorId;

	@TableField(value = "counselor_id")
	private Long counselorId;

	@TableField(value = "counselor_name")
	private String counselorName;

	@TableField(value = "discount_detail")
	private String discountDetail ;

	@TableField(value = "pay_lecture_amount")
	private Integer payLectureAmount ;

	/**  */
	@TableField(value = "last_pay_time")
	private Date lastPayTime ;

	public Date getLastPayTime() {
		return lastPayTime;
	}

	public void setLastPayTime(Date lastPayTime) {
		this.lastPayTime = lastPayTime;
	}

	public Integer getPayLectureAmount() {
		return payLectureAmount;
	}

	public void setPayLectureAmount(Integer payLectureAmount) {
		this.payLectureAmount = payLectureAmount;
	}

	public String getDiscountDetail() {
		return discountDetail;
	}

	public void setDiscountDetail(String discountDetail) {
		this.discountDetail = discountDetail;
	}

	public Long getCourseOrderId() {
		return courseOrderId;
	}

	public void setCourseOrderId(Long courseOrderId) {
		this.courseOrderId = courseOrderId;
	}

	public Integer getStartAmount() {
		return startAmount;
	}

	public void setStartAmount(Integer startAmount) {
		this.startAmount = startAmount;
	}

	public Integer getEndAmount() {
		return endAmount;
	}

	public void setEndAmount(Integer endAmount) {
		this.endAmount = endAmount;
	}


	public Long getRegId() {
		return this.regId;
	}

	public void setRegId(Long regId) {
		this.regId = regId;
	}

	public Long getStudentId() {
		return this.studentId;
	}

	public void setStudentId(Long studentId) {
		this.studentId = studentId;
	}

	public String getStudentName() {
		return this.studentName;
	}

	public void setStudentName(String studentName) {
		this.studentName = studentName;
	}

	public Long getClassId() {
		return this.classId;
	}

	public void setClassId(Long classId) {
		this.classId = classId;
	}

	public String getClassName() {
		return this.className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public Integer getRegStatus() {
		return this.regStatus;
	}

	public void setRegStatus(Integer regStatus) {
		this.regStatus = regStatus;
	}

	public Integer getChargingStatus() {
		return this.chargingStatus;
	}

	public void setChargingStatus(Integer chargingStatus) {
		this.chargingStatus = chargingStatus;
	}

	public BigDecimal getTotalAmount() {
		return this.totalAmount;
	}

	public void setTotalAmount(BigDecimal totalAmount) {
		this.totalAmount = totalAmount;
	}

	public BigDecimal getPayAmount() {
		return this.payAmount ;
	}

	public void setPayAmount(BigDecimal payAmount) {
		this.payAmount = payAmount;
	}

	public Integer getRegFrom() {
		return this.regFrom;
	}

	public void setRegFrom(Integer regFrom) {
		this.regFrom = regFrom;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Long getFinancialOwnerId() {
		return financialOwnerId;
	}

	public void setFinancialOwnerId(Long financialOwnerId) {
		this.financialOwnerId = financialOwnerId;
	}

	public Integer getRefundStatus() {
		return refundStatus;
	}

	public void setRefundStatus(Integer refundStatus) {
		this.refundStatus = refundStatus;
	}

	public Long getAreaTeamId() {
		return areaTeamId;
	}

	public void setAreaTeamId(Long areaTeamId) {
		this.areaTeamId = areaTeamId;
	}

	public Long getBusTeamId() {
		return busTeamId;
	}

	public void setBusTeamId(Long busTeamId) {
		this.busTeamId = busTeamId;
	}

	public Long getPeriodId() {
		return periodId;
	}

	public void setPeriodId(Long periodId) {
		this.periodId = periodId;
	}

	public BigDecimal getSrcTotalAmount() {
		return srcTotalAmount;
	}

	public void setSrcTotalAmount(BigDecimal srcTotalAmount) {
		this.srcTotalAmount = srcTotalAmount;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public Long getSeniorId() {
		return seniorId;
	}

	public void setSeniorId(Long seniorId) {
		this.seniorId = seniorId;
	}

	public String getSeniorName() {
		return seniorName;
	}

	public void setSeniorName(String seniorName) {
		this.seniorName = seniorName;
	}

	public Long getOperatorId() {
		return operatorId;
	}

	public void setOperatorId(Long operatorId) {
		this.operatorId = operatorId;
	}

	public Long getCounselorId() {
		return counselorId;
	}

	public void setCounselorId(Long counselorId) {
		this.counselorId = counselorId;
	}

	public String getCounselorName() {
		return counselorName;
	}

	public void setCounselorName(String counselorName) {
		this.counselorName = counselorName;
	}

	public BigDecimal getRefundAmount() {
		return refundAmount;
	}

	public void setRefundAmount(BigDecimal refundAmount) {
		this.refundAmount = refundAmount;
	}

	public Integer getInitStartAmount() {
		return initStartAmount;
	}

	public void setInitStartAmount(Integer initStartAmount) {
		this.initStartAmount = initStartAmount;
	}

	public Integer getInitEndAmount() {
		return initEndAmount;
	}

	public void setInitEndAmount(Integer initEndAmount) {
		this.initEndAmount = initEndAmount;
	}

	@Override
	public int compareTo(StudentReg o) {
		int c  = this.getTotalAmount().subtract(this.getPayAmount() == null ? BigDecimal.ZERO : this.getPayAmount() ).compareTo(o.getTotalAmount().subtract( o.getPayAmount() == null ? BigDecimal.ZERO : o.getPayAmount() ));
		return c == 0 ? this.getRegId().compareTo(o.getRegId()) : c ;
	}
}
